#include <stdio.h>
#include <string.h>

float Strfloat(const char *s)
{

    float result = 0.0;
    int sign = 1;
    float count = 0.1;
    int flag = 0;
    if (s[0] == '-')
    {
        sign = -1;
    }
    while (*s != '\0')
    {
        if (*s == '.')
        {
            flag = 1;
        }
        if (*s <= '9' && *s >= '0' && flag == 0)
        {
            result = result * 10 + *s - '0';
        }
        if (*s <= '9' && *s >= '0' && flag == 1)
        {
            result += (*s - '0')*count;
            count*=0.1;
        }

        s++;
    }
    
    return result * (sign); 
}

int main()
{
    char a[] = "-123.4599";

    printf("%0.4f\n", Strfloat(a));

    return 0;
}
